home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / EleOfC++ vrs 0.1 / PictView / externalPascals.c next >
Encoding:
C/C++ Source or Header  |  1991-07-14  |  1.1 KB  |  35 lines  |  [TEXT/KAHL]

  1. /*
  2. ** This is the external and pascal functions and variables used in
  3. ** for TScrollDoc.  This class is an adaptation of 
  4. ** the class of the same name in the book, Elements of C++ Macintosh 
  5. ** Programming, by Dan Weston.
  6. **
  7. ** Copyright © 1991 Mark Gross 
  8. ** (RR2, Box 84, Clayville, NY 13322);         
  9. ** this file may be published everywhere, but no charge
  10. ** may be made for its use.  Please contact me about any bugs found.
  11. ** I'm also looking for Macintosh development work, so drop me a line
  12. ** if you think I could help.  
  13. **    
  14. */
  15.  
  16. #include "TScrollDoc.h"
  17.     
  18. pascal void ActionProc(ControlHandle theControl, short partCode)
  19. {
  20.     short scrollAmount = 0;
  21.     TScrollDoc *theCurrScrollDoc;
  22.     extern TScrollDoc *gCurrScrollDoc;
  23.     
  24.     theCurrScrollDoc = gCurrScrollDoc;
  25.     if(theControl == theCurrScrollDoc->GetVScroll() )
  26.         scrollAmount = theCurrScrollDoc->GetVertLineScrollAmount();
  27.     if( theControl == theCurrScrollDoc->GetHScroll())
  28.         scrollAmount = theCurrScrollDoc->GetHorizLineScrollAmount();
  29.     
  30.     if(partCode == inUpButton)
  31.         theCurrScrollDoc->Scroll(theControl, -scrollAmount);
  32.     if(partCode == inDownButton)
  33.         theCurrScrollDoc->Scroll(theControl, scrollAmount);
  34. }/*end of function*/
  35.